import { observable, action } from "mobx";

let mobile = '13266858126';
let token = '123456';
let userId = '123123';

// 全局数据状态管理
class RootStore{
  // 手机号码
  @observable mobile = mobile;
  // token
  @observable token = token;
  // 用户id
  @observable userId = userId;

  @action
  setUserInfo(mobile, token, userId){
    this.mobile = mobile;
    this.token = token;
    this.userId = userId;
  }

  @action
  clearInfo(){
    this.mobile = '';
    this.token = '';
    this.userId = '';
  }
}

export default new RootStore();